package com.bsj.power.job.config.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

/**
 * @author yinhao
 * @version 1.0
 * @description 线程配置
 * @date 2024/8/7
 */
@Profile({"power-module-pls"})
@Component
public class QueueConstant {
    /**
     * 工作线程数
     */
    public static Integer worker;
    /**
     * 最大工作线程数
     */
    public static Integer maxWorker;
    /**
     * 每次取出的数量
     */
    public static Integer popCount;

    @Value("${handle.worker}")
    public void setWorker(Integer worker) {
        QueueConstant.worker = worker;
    }

    @Value("${handle.maxWorker}")
    public void setMaxWorker(Integer maxWorker) {
        QueueConstant.maxWorker = maxWorker;
    }

    @Value("${handle.popCount}")
    public void setPopCount(Integer popCount) {
        QueueConstant.popCount = popCount;
    }
}
